<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding:0px;
            list-style: none;
        }
        textarea{
            width: 1000px;
            margin:0px auto;
            display: block;   
            background: darkseagreen;
        }
        button{
            width: 1000px;
            margin:0px auto;
            color:khaki;
            display: block;
            background:darkgreen;
            line-height: 40px;
        }
         ul>li{
            background: olivedrab;
            margin-bottom: 10px;
        }
        ul{
            width: 700px;
            margin:10px auto;
        } 
        span{
            position: absolute;
            right:-5px;
            top:-5px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <textarea name="" id="txt" cols="30" rows="10" ></textarea>
    <button id="btn">微博发布</button>
    <ul id="box">
        <li>
        金泰你不错
        <p>2034-08-08</p>
        <span onclick="del(this)">X</span>
        </li>
    </ul>
    <script >
        btn.onclick=function(){
            if(txt.value==''){
                alert('什么东西')
            }
            else{
                var d=new Date();
                console.log(d)
                var tag=document.createElement('li');
                tag.innerHTML=` ${val}
                <p>${year}-${month}-${date}</p>
                <span  onclick="del(this)">X</span>`
                box.appendChild(tag);
            }
        }
    </script>
</body>
</html>